@import com.example.auction.item.api.ItemStatus

@(title: String)(content: Html)(implicit nav: Nav)

<html>
    <head>
        <title>@title</title>
        <link rel="stylesheet" type="text/css" href="@routes.Assets.at("lib/foundation/dist/foundation.min.css")"/>
        <link rel="stylesheet" type="text/css" href="@routes.Assets.at("lib/foundation-icon-fonts/foundation-icons.css")"/>
        <link rel="stylesheet" type="text/css" href="@routes.Assets.at("css/main.css")"/>
    </head>
    <body>
        <nav class="top-bar">
            <div class="top-bar-left">
                <ul class="menu">
                    <li><a href="@routes.Main.index()">@message("lagomAuction")</a></li>
                    <li><a href="@routes.UserController.createUserForm()">@message("createUser")</a></li>
                    <li><a href="@routes.ItemController.createItemForm()">@message("createItem")</a></li>
                    <li><a href="@routes.UserController.loginUserForm()">
                    @if(!nav.getUser.isPresent) {
                        @message("loginWith")
                    } </a></li>
                  <li><a href="@routes.UserController.logoutUser()">
                        @if(nav.getUser.isPresent) {
                          @message("logout")}</a></li>
                </ul>
            </div>
            <div class="top-bar-right">
                <ul class="menu dropdown" data-dropdown-menu>
                    <li><a href="@routes.SearchController.searchForm()">@message("search")</a></li>
                    <li>
                        <a href="@ProfileController.defaultProfilePage">@if(nav.getUser.isPresent) {
                            @nav.getUser.get.getName
                        } else {
                            @message("logInAs")
                        }</a>
                        <ul class="menu vertical">
                        @for(user <- nav.getUsers) {
                            <li><a href="#" data-user-id="@user.getId" class="log-in-as">@user.getName</a></li>
                        }
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
        <article class="row">
            <div class="small-12">
            @content
            </div>
        </article>
        <script type="text/javascript" src="@routes.Assets.at("lib/jquery/jquery.min.js")"></script>
        <script type="text/javascript" src="@routes.Assets.at("lib/foundation/dist/foundation.min.js")"></script>
        <script type="text/javascript" src="@routes.Assets.at("js/main.js")"></script>
        <script>
                $(document).foundation();
        </script>
    </body>
</html>
